#ifndef SHOGIDEF_H_INCLUDED
#define SHOGIDEF_H_INCLUDED

#define SHOGI_SERVER_VERSION "0.01"

#include <QString>

typedef unsigned int Player;
typedef unsigned int GameState;	


enum GAME_STATES
{
	INITIALISED,				
	HANDSHAKE,	
	WAIT_FOR_PLAYER,
	GAME_NEGOTIATION,
	IN_GAME,		
	FINISHED_GAME,	
	WAIT_FOR_RECONNECT,
	ALL_STATES
};

enum PLAYERS
{
	PLAYER_ONE =0,
	PLAYER_TWO 
};


static QString getStateString(GameState s)
{
	QString strState;

	switch(s)
	{
	case INITIALISED:
		strState = "INITIALISED";
		break;
	case HANDSHAKE:
		strState = "HANDSHAKE";
		break;
	case WAIT_FOR_PLAYER:
		strState = "WAIT_FOR_PLAYER";
		break;
	case GAME_NEGOTIATION:
		strState = "GAME_NEGOTIATION";
		break;
	case IN_GAME:
		strState = "IN_GAME";
		break;
	case FINISHED_GAME:
		strState = "FINISHED_GAME";
		break;
	case WAIT_FOR_RECONNECT:
		strState = "WAIT_FOR_RECONNECT";
		break;
	default:
		strState = "<state string missing>";
		break;
		
	}

	return strState;
}

static Player getOtherPlayer(Player p)
{
	if (p==PLAYER_ONE)
		return PLAYER_TWO;
	else
		return PLAYER_ONE;
}

#endif // SHOGIDEF_H_INCLUDED

